package com.zzz.springcloud.controller;

import com.zzz.springcloud.service.PaymentHystrixService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class OrderController {
    @Resource
    PaymentHystrixService paymentHystrixService;

    @GetMapping("/consumer/payment/hystrix/ok")
    public String getPaymentOk() {
        return paymentHystrixService.getPaymentOK();
    }

    @GetMapping("/consumer/payment/hystrix/timeout")
    public String getPaymentTimeout() {
        return paymentHystrixService.getPaymentTimeOut();
    }

    @GetMapping("/consumer/payment/hystrix/global")
    public String getPaymentTimeoutGlobal() {
        return paymentHystrixService.getPaymentTimeOut();
    }

}
